<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@ include file="/common/taglibs.jsp" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>设备状态</title>
    <%@ include file="/common/util.jsp" %>
    <!-- <script src="${cdnctx}/dep/jquery/modernizr.js"></script> -->
    <!-- <script src="${cdnctx}/dep/jquery/spin.js"></script> -->
    <!-- <script type="text/javascript" src="${cdnctx }/src/collectdata/collectDataDetail.js"></script> -->
    <script type="text/javascript">
        $(function () {
            var minute_order = 'useminute,gatewayid,SensorID,ChannelID';
            <!--修改工作状态排序-->
            var default_order = 'gatewayid,SensorID,ChannelID';
            var sidx = '${sidx}';
            var myhref = $('#new_order').attr('href');
            if (sidx == minute_order) {
                $('#new_order').attr('href', myhref + '&sidx=' + default_order);
            } else {
                $('#new_order').attr('href', myhref + '&sidx=' + minute_order);
            }
            $('#mysubmit').click(function () {    <!--采集设备节点数字格式判断-->
                var mysensorid = $.trim($('#sensorid').val());

                if (isNaN(mysensorid) && mysensorid != '' || mysensorid.length > 4) {
                    $("#error").show();
                } else {
                    $("#error").hide();
                    $('form').submit();
                }
            });


        });

        function jumpPage(pageIndex) {
            window.location.href = "${cdnctx}/economicBenefit/devicestatus.shtml?" + $.param($("#economicBenefitForm").serializeObject()) + "&pageIndex=" + pageIndex + "&companycode=${companycode }";
        }
    </script>
</head>
<body class="main">
<div class="-frame -style -luster" id="css_container">
    <!--首页框架页眉部分↓-->
    <%@ include file="/WEB-INF/pages/inc/header.jsp" %>
    <!--首页框架页眉部分↑-->

    <div class="content">

        <!-- Left导航菜单◎开始 -->
        <%@ include file="/WEB-INF/pages/inc/leftmenu.jsp" %>
        <!-- Left导航菜单◎结束 -->
        <div class="main-mid">
            <div class="pos">
                <img src="${cdnctx}/src/index/img/index.png"><a
                    href="${cdnctx}/system/customerinfo/customerList.shtml">能源管理 </a>
                ><a href="JavaScript:void(0);">${customername}_设备状态</a>
                    <span style="float: right;margin-right: 25px;">
                        <a href="${cdnctx}/business/init.shtml?companycode=${companycode }">项目实施</a>
                        | <a href="${cdnctx}/energy/AreaEnergy.shtml?customerinfoid=${customerInfo.id}">区域管理</a>
                        | <a
                            href="${cdnctx}/operate/operatelist.shtml?customerinfoid=${customerInfo.id }">运营维护</a></span>
            </div>
            <div class="css_contentDiv">
                <form id="economicBenefitForm" action="${cdnctx}/economicBenefit/devicestatus.shtml" method="post">
                    <div style="padding:10px;">
                        <input type="hidden" name="companycode" value="${companycode }"/>
                        <input type="hidden" name="sidx" value="${sidx }"/>
                        <label class="search_text">物联网关:</label>
                        <input type="text" class="search_input" id="gatewayid" name="gatewayid"
                               value="${areaPoint.gatewayid}">
                        <label class="search_text">采集设备节点:</label>
                        <input type="text" class="search_input" id="sensorid" name="sensorid"
                               value="${areaPoint.sensorid}">
                        <input id="mysubmit" type="button" class="search_btn" value="查&nbsp;询"/>
                        <input type="reset" class="reset_btn" value="重&nbsp;置"/>
                        <span id="error" style="color: red;display:none">请输入正确格式的采集设备节点</span>
                    </div>
                </form>
                <div class="divTable">
                    <div class="detailDiv" style="background-color:white">
                        <table class="list_table">
                            <thead>
                            <tr>
                                <td>物联网关</td>
                                <td>采集设备（节点）</td>
                                <td>采集区域（通道）</td>
                                <td>
                                    <u>
                                        <a id="new_order"
                                           href="${cdnctx}/economicBenefit/devicestatus.shtml?gatewayid=${collectArea.gatewayid}&sensorid=${collectArea.sensorid}&companycode=${companycode }">工作状态</a>
                                    </u>
                                </td>
                            </tr>
                            </thead>
                            <c:if test="${empty(areaPoints) }">
                                <tr class="even" style="color:red">
                                    <td colspan="10" class="no-data" style="height: 300px;"></td>
                                </tr>
                            </c:if>
                            <c:if test="${not empty(areaPoints) }">
                                <c:forEach items="${areaPoints}" var="entity" varStatus="status">
                                    <tr <c:if test="${entity.useminute == 0 }">style="background: #F3F6FB"</c:if>>
                                        <td><u><a href="JavaScript:void(0);">${entity.gatewayid}</a></u></td>
                                        <td>${entity.sensorid}</td>
                                        <td><u><a href="JavaScript:void(0);">${entity.channelid}</a></u></td>
                                        <td <c:if test="${entity.useminute == 0 }">style="color: red;"</c:if>><c:if
                                                test="${entity.useminute == 0 }">未工作</c:if></td>
                                    </tr>
                                </c:forEach>
                            </c:if>
                        </table>
                    </div>
                    <c:if test="${not empty(areaPoints) }">
                        <div id="pageInfo" class="pageJump">
                            <script type="text/javascript">
                                pagination.getPaginationHtml('JavaScript:jumpPage({0})', ${pageIndex}, ${pageCount}, 'pageInfo');
                            </script>
                            共有${dataCount}条数据
                        </div>
                    </c:if>
                </div>
            </div>
        </div>
    </div>
    <!--首页框架页尾部分↓-->
    <%@ include file="/WEB-INF/pages/inc/footer.jsp" %>
    <!--首页框架页尾部分↑-->
</div>
</body>
</html>
